import request from '@/config/axios'

export interface ProductionPreparePackingVO {
  id: number
  inventoryId: string
  inventoryNumber: string
  orderNumber: string
  customerName: string
  productNumber: string
  productName: string
  location: string
  boxSize: string
  boxName: string
  locationTime: string
  dictPackingStatus: number
  creatorName: string
  updaterName: string
}

// 查询生产管理--产品管理—装箱清单列表
export const getProductionPreparePackingPage = async (params) => {
  return await request.get({ url: `/produce/production-prepare-packing/page`, params })
}

// 查询生产管理--产品管理—装箱清单详情
export const getProductionPreparePacking = async (id: number) => {
  return await request.get({ url: `/produce/production-prepare-packing/get?id=` + id })
}

// 新增生产管理--产品管理—装箱清单
export const createProductionPreparePacking = async (data: ProductionPreparePackingVO) => {
  return await request.post({ url: `/produce/production-prepare-packing/create`, data })
}

// 修改生产管理--产品管理—装箱清单
export const updateProductionPreparePacking = async (data: ProductionPreparePackingVO) => {
  return await request.put({ url: `/produce/production-prepare-packing/update`, data })
}

// 删除生产管理--产品管理—装箱清单
export const deleteProductionPreparePacking = async (id: number) => {
  return await request.delete({ url: `/produce/production-prepare-packing/delete?id=` + id })
}

// 导出生产管理--产品管理—装箱清单 Excel
export const exportProductionPreparePacking = async (data) => {
  return await request.download({ url: `/produce/production-prepare-packing/export-excel`, data })
}

//作废生产管理--产品管理—装箱清单
export const cancelProductionPreparePacking = async (data) => {
  return await request.download({ url: `/produce/production-prepare-packing/cancel`, data })
}

// 查询生产管理--产品管理--备货清单列表（清单编号）
export const getProductionPreparePage = async (params) => {
  return await request.get({ url: `/produce/production-prepare/page`, params })
}

// 选择部件
export const getProductionPrepareComponentPage = async (params) => {
  return await request.get({ url: `/produce/production-prepare-detail/page`, params })
}